package hci;

import observerNotification.ErrorObserverNotification;
import observerNotification.QuestionObserverNotification;


/**
 * Contains any action directed to user from the interface
 * 
 * <p>
 * <ul>
 * <li>Project: 	ChatSystemG3</li>
 * </ul>
 * </p>
 * 
 * @author COMBES Nicolas - LECHANTRE Arnaud
 */
public interface ToUser {

	/**
	 * Switches the main frame to connected view
	 */
	public void showConnectedView(String username);
	
	/**
	 * Switch the interface to disconnected view
	 */
	public void showDisconnectedView();
	
	/**
	 * Adds/removes the user to/from the user list
	 * @param add	: true if user is to be added, false on the contrary
	 * @param username : username of the user to be added
	 * @param convId : identifier of the conversation with the user (and only them)
	 */
	public void updateConnectedUserList(boolean add, String username , int convId);
	
	/**
	 * Creates a conversation frame for the new conversation
	 * 
	 * @param convID : unique identifier of the conversation, used by the model to recognize it
	 * @param usernames : name of the user(s) to add to the conversation
	 */
	void showConversation(int convID, String[] usernames, String localUserName);
	
	/**
	 * Shows the message received in the designated conversation
	 * @param convID : unique identifier of the conversation
	 * @param message : message to be shown to the user
	 * @param sender : sender username
	 */
	public void showMessage (int convID, String sender, String message);
	
	/**
	 * Displays the notification in the appropriate window
	 * @param convID : unique identifier of the conversation, value -1 for mainframe
	 * @param notification : message to be notified
	 */
	public void showNotification (int convID, String notification);
	
	/**
	 * Displays the error in the appropriate window
	 * @param convID : unique identifier of the conversation, value -1 for mainframe
	 * @param e : error to be displayed
	 * 
	 */
	public void showError(int convID, ErrorObserverNotification e);
	
	/**
	 * showFileRequest
	 * @param convID : unique identifier of the conversation where the file request is purposed
	 * @param sender : username of the sender
	 * @param fileName : name of the file to be sent
	 * @param fileSize : size of the file to be sent
	 */
	public void showFileRequest(int convID, String sender, String fileName, long fileSize);

	/**
	 * Closes all openned conversations
	 */
	public void closeConversations();
	
	/**
	 * performChangeTongue
	 * @param tongue name of the selected tongue
	 */
	public void performChangeTongue(String tongue);

	/**
	 * showConfirmDialog
	 * @param question a question to display to the user
	 */
	void showConfirmDialog(QuestionObserverNotification question);
}
